<template>
	<div class="book-info">
		<book-detail :info="info" :bookid="bookid"></book-detail>
		<div>
			<legend>标签</legend>
			<tag v-for="item in info.type" :info="item" :type="'style1'"></tag>
		</div>
		<div>
			<legend>Ta的权利</legend>
			<tag v-for="item in info.right" :info="item" :type="'style2'"></tag>
		</div>
		<span>版权声明：一切权利归作者/著作权所有者，未经许可，不得转载或以任何商业用途使用</span>
	</div>
</template>
<script>
	import BookDetail from './BookDetail'
	import Tag from './Tag'
	import {updateTitle} from './../../vuex/action'
	import {getBookData} from './../../js/data'

	export default {
		data: function () {
			return {
				info: {},
				bookid: this.$route.params.bookid
			}
		},
		components: {
			BookDetail,
			Tag
		},
		vuex: {
			actions: {
				updateTitle
			}
		},
		route: {
			activate: function () {
				let bookid = this.$route.params.bookid
				this.info = getBookData(bookid)
			}
		}
	}
</script>
<style scoped>
	.book-info {
		padding: 0 20px;
	}
	.book-info>div {
		margin-bottom: 20px;
		background-color: #FFF;
		padding: 10px 0;
	}
</style>